<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
		<title>店铺首页</title>
		<link rel="stylesheet" href="css/base.css" />
		<link rel="stylesheet" href="css/all.css" />
		<link rel="stylesheet" href="css/iconfont.css" />
		<link rel="stylesheet" href="css/store-shelves.css" />
	</head>

	<body>
		<div>
			<div class="head">
				<span href="javascript:;" onclick="go()">
        <i class="iconfont icon-iconfontjiantou1"></i></span>
				<h1 class="titles">店铺首页</h1>
			</div>
			<div class="middle-one">
				<div class="shop">
					<div class="row">
						<div onclick="location.href='./shop-modify.html'" class="logo">
							<img src="img/500473822.png" alt="" id="storeImg">
						</div>
						<div onclick="location.href='./shop-modify.html'" class="firm">
							<span id="storeName">陌上浅笑</span>
						</div>
						<div onclick="location.href='./chat.html'" class="message">
							<i class="iconfont icon-xiaoxi"></i>
							<span>消息</span>
						</div>
						<div onclick="location.href='./order-income.html'" class="order">
							<i class="iconfont icon-dingdan"></i>
							<span>订单收入</span>
						</div>
					</div>
					<p class="intro" id="storeIntro">店铺简介店铺简介</p>
				</div>
				<div class="sold-out">
					<div onclick="location.href='./shop-page.html'" class="sold flex">
						<div class="sell">
							<span>出售中</span>
						</div>
						<div onclick="location.href='./store-shelves.html'" class="solds">
							<span>已下架</span>
						</div>
					</div>
				</div>
				<div id="sold-out">
					<div class="refer">
						<div onclick="location.href='./shelves-edit.html'" class="introduce row">
							<div class="picture">
								<img src="img/shangpin.png" alt="">
								<img src="img/xiajia.png" alt="">
							</div>
							<div class="design">
								<p>灯具</p>
								<p>￥150.00</p>
								<span>总销量 0</span><span>30日成交额 0.00</span>
								<span>库存 69</span><span>添加 2018/08/30</span>
							</div>
							<div class="tag">
								<i class="iconfont icon-youjiantou"></i>
							</div>
						</div>
						<div class="popular">
							<div class="gener">
								<i class="iconfont icon-fenxiang"></i>
								<span>推广</span>
							</div>
							<div class="geners">
								<i class="iconfont icon-icon_share"></i>
								<span>分享</span>
							</div>
						</div>
					</div>
					<div class="refer">
						<div onclick="location.href='./shelves-edit.html'" class="introduce row">
							<div class="picture">
								<img src="img/shangpin.png" alt="">
								<img src="img/xiajia.png" alt="">
							</div>
							<div class="design">
								<p>灯具</p>
								<p>￥150.00</p>
								<span>总销量 0</span><span>30日成交额 0.00</span>
								<span>库存 69</span><span>添加 2018/08/30</span>
							</div>
							<div class="tag">
								<i class="iconfont icon-youjiantou"></i>
							</div>
						</div>
						<div class="popular">
							<div class="gener">
								<i class="iconfont icon-fenxiang"></i>
								<span>推广</span>
							</div>
							<div class="geners">
								<i class="iconfont icon-icon_share"></i>
								<span>分享</span>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="footer">
				<ul class="row">
					<li onclick="location.href='./add-goods.html'" class="new-product">
						<i class="iconfont icon-tianjia"></i>
						<span>发布新品</span>
					</li>
					<li onclick="location.href='./batch-management.html'" class="news-product">
						<i class="iconfont icon-batch-execution"></i>
						<span>批量管理</span>
					</li>
					<li class="new-product">
						<i class="iconfont icon-baoxianchanpin"></i>
						<span>店铺保证</span>
					</li>
				</ul>
			</div>
		</div>
		<div id="mask">
		</div>
		<div id="is_link">
			<div>
				复制链接成功！请到多艺“<em>广告植入</em>”进行推广!
			</div>
			<button>取消</button>
		</div>
		<div id="is_share">
			<p>分享到</p>
			<div>
				<ul class="row">
					<li>
						<img src="img/weixin.png" alt="">
						<span>微信</span>
					</li>
					<li>
						<img src="img/rengyouquan.png" alt="">
						<span>朋友圈</span>
					</li>
					<li>
						<img src="img/qq.png" alt="">
						<span>QQ好友</span>
					</li>
					<li>
						<img src="img/weibo.png" alt="">
						<span>微薄</span>
					</li>
				</ul>
			</div>
			<button>取消</button>
		</div>
		</div>

		<script src="js/x_rem.js"></script>
		<script src="./js/jquery-1.10.2.js"></script>
		<script src="js/all.js"></script>
		<script>
			$("#mask").click(function(e) {
				if(e.target !== $("#is_show")) {
					$(this).hide();
					$("#is_show").hide();
				}
			})
			$(function() {
				$(".refer>.popular>.gener>span").click(function() {
					$("#is_link").css("display", "block");
					$("#mask").css("display", "block");
				})
				$("#is_link>button").click(function() {
					$("#is_link").hide();
					$("#mask").hide();
				})
			})
			$(function() {
				$(".refer>.popular>.geners>span").click(function() {
					$("#is_share").css("display", "block");
					$("#mask").css("display", "block");
				})
				$("#is_share>button").click(function() {
					$("#is_share").hide();
					$("#mask").hide();
				})
			})

			//店铺信息
			$(function() {

				var data = JSON.stringify({

				});

				var success = (data) => {
					if(data.message.code == 200) {
						$("#storeName").html(data.data.storeInfo.name); //店铺名字
						$("#storeImg").attr("src", data.data.storeInfo.picture); //店铺图片
						$("#storeIntro").html(data.data.storeInfo.introduce); //店铺简介
					} else {
						console.log(data.message.msg)
						alert(data.message.msg);
					}
				};

				Hajax("post", "/app/store/index", data, success);

			});

			//已经下架的商品
			$(function() {
				var data = JSON.stringify({
					"index": 0,
					"size": 10,
					"status": 1
				});

				var success = (data) => {
					var html = "";

					for(let i = 0; i < data.data.productList.length; i++) {
						html += `
							<div class="refer">
								<div onclick="location.href='./edit-commodity.html?productId=${data.data.productList[i].productId}'" class="introduce row">
									<div class="picture">
										<img src="${data.data.productList[i].picture}" alt="">
									</div>
									<div class="design">
										<p>${data.data.productList[i].title}</p>
										<p>￥${data.data.productList[i].nowPrice}</p>
										<span>总销量 ${data.data.productList[i].saleAmount}</span><span>30日成交额 ${data.data.productList[i].sellCount}</span>
										<span>库存 ${data.data.productList[i].stock}</span><span>添加 2018/08/30</span>
									</div>
									<div class="tag">
										<i class="iconfont icon-youjiantou"></i>
									</div>
								</div>
								<div class="popular">
									<div class="gener">
										<i class="iconfont icon-fenxiang"></i>
										<span>推广</span>
									</div>
									<div class="geners">
										<i class="iconfont icon-icon_share"></i>
										<span>分享</span>
									</div>
								</div>
							</div>
						`

					}
					$("#sold-out").html(html);
				};

				Hajax("post", "/supplier/product/getProductInfo", data, success);

			});
		</script>
	</body>

</html>